home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl760 / scnp785j.lzh / LONGTIME.FIT < prev    next >
Text File  |  1992-09-11  |  2KB  |  88 lines

  1. * Start Nonlinear Curve Fitter program then type command: LOAD LONGTIME.FIT
  2. *
  3. *   Read the data that is to be fit.
  4. read 51
  5.  0 .1001
  6. .0588 2.23
  7. .1176 3.85
  8. .1764 4.78
  9. .2352 4.66
  10. .2941 3.90
  11. .3529 2.15
  12. .4117 .509
  13. .4705 -1.53
  14. .5294 -2.70
  15. .5882 -3.87
  16. .6470 -3.73
  17. .7058 -3.40
  18. .7647 -2.03
  19. .8235 -.844
  20. .8823 .7845
  21. .9411 1.954
  22. 1  2.79
  23. 1.058 3.07
  24. 1.117 2.69
  25. 1.176 2.10
  26. 1.235 .703
  27. 1.294 -.183
  28. 1.352 -1.55
  29. 1.411 -1.81
  30. 1.470 -2.69
  31. 1.529 -2.03
  32. 1.588 -1.91
  33. 1.647 -.830
  34. 1.705 -.153
  35. 1.764 .965
  36. 1.823 1.44
  37. 1.882 1.94
  38. 1.941 1.84
  39. 2  1.51
  40. 2.058 .929
  41. 2.117 .116
  42. 2.176 -.463
  43. 2.235 -1.23
  44. 2.294 -1.39
  45. 2.352 -1.58
  46. 2.411 -1.19
  47. 2.470 -1.12
  48. 2.529 -.130
  49. 2.588 .152
  50. 2.647 .951
  51. 2.705 .947
  52. 2.764 1.30
  53. 2.823 .981
  54. 2.882 .870
  55. 2.941 .316
  56. *
  57. *   Set the number of parameters (p1, p2 & p3).
  58. numpar 3
  59. *
  60. *   Enter initial estimates of the parameters.
  61. p1 = 10
  62. p2 = 10
  63. p3 = 10
  64. *
  65. *   Enter the equation that is to be fit to the data.
  66. y(x)= p1 * exp(-p2*x) * sin(p3*x)
  67. *
  68. *   Partial derivatives will be numerically approximated.
  69. partials off
  70. *
  71. *   Plot the fit using the initial parameter values;
  72. *   shows that the initial parameter values give a poor fit.
  73. wait
  74. plotfit
  75. *
  76. *   Find a better fit.
  77. *
  78. * WARNING:  It will take a while to find a better fit (48 seconds on a
  79. *           25 MHz 386 PC without a co-processor); press ESC key to abort.
  80. fit
  81. *
  82. *   Plot the improved fit.
  83. wait
  84. plotfit
  85. *
  86. *   Output fit parameters (optionally to a printer or a file).
  87. outfit
  88.